package com.hfkh;

import java.util.Scanner;

/**
 * @Author MDD
 * @Description
 * @Version
 * @Date
 **/
public class No_5 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个整数:");
        int max;
        int min;
        int num;
        min=max=num = sc.nextInt();
        while (num != 0) {
            if (num < min) {
                min = num;
            }
            if (num > max) {
                max = num;
            }
            System.out.println("请继续输入,输入0结束");
            num = sc.nextInt();
        }
        System.out.println("最大值=" + max + " 最小值=" + min);

    }
}
